script_info = {
	["title"] = "加速下载通道",
	["version"] = "0.0.4",
	["description"] = "请将下载线程修改为2，并行为1！",
	["color"] = "#665cf0",
}
     
function onInitTask(task, user, file)
    if task:getType() ~= TASK_TYPE_BAIDU then
        return false
    end
    if user == nil then
        task:setError(-1, "用户未登录")
		return true
	end	
	if user:isSVIP() then
        task:setError(-1, "暂不支持会员用户")
	end	
    task:setUris("http://d.pcs.baidu.com/rest/2.0/pcs/file?app_id=778750&method=download&path="..pd.urlEncode(file.path))
    task:setOptions("user-agent", "netdisk;6.0.0.12;PC;PC-Windows;10.0.16299;WindowsBaiduYunGuanJia")
    task:setOptions("header", "Cookie: "..user:getCookie())
	task:setIcon("icon/accelerate.png", "禁止分享该脚本！")
    return true
end